package cn.swing.his.pojo.search.finance.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@Document(indexName = "his_finance_detail_index")
@ApiModel(value="对应搜索的文档entity")
public class FinanceDetailEntity implements Serializable {
    private static final long serialVersionUID=1L;
    /**
     * id
     */
    @Id
    @ApiModelProperty(value = "financeDetail id")
    private Integer id;

    /**
     * 交易人名
     */
    @Field(name = "name",type = FieldType.Text,
            analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value="交易人名")
    private String name;

    /**
     * 收支类型
     */
    @Field(name = "type")
    @ApiModelProperty(value = "收支类型 0表示收入 1表示支出")
    private String type;

    /**
     * 交易金额
     */
    @Field(name = "price")
    @ApiModelProperty(value = "交易金额")
    private Double price;

    /**
     * 交易时间
     */
    @Field(name = "deal_time")
    @ApiModelProperty(value = "交易时间")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String dealTime;
    /**
     * 交易描述
     */
    @Field(name = "description",type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value = "备注")
    private String description;

//    /**
//     * 创建时间
//     */
//    @Field(name = "gmt_created")
//    @ApiModelProperty(value = "创建时间")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    private Date gmtCreated;
//
//    /**
//     * 修改时间
//     */
//    @Field(name = "gmt_modified")
//    @ApiModelProperty(value = "修改时间")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    private Date gmtModified;
}
